<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<script type="text/javascript">
	$(function() {
		
		$('#companyEditForm').form({
			url : '${ctx}/company/edit',
			onSubmit : function() {
				progressLoad();
				var isValid = $(this).form('validate');
				if (!isValid) {
					progressClose();
				}
				return isValid;
			},
			success : function(result) {
				progressClose();
				result = $.parseJSON(result);
				if (result.success) {
					parent.$.modalDialog.openner_dataGrid.datagrid('reload');//之所以能在这里调用到parent.$.modalDialog.openner_dataGrid这个对象，是因为user.jsp页面预定义好了
					parent.$.modalDialog.handler.dialog('close');
				} else {
					parent.$.messager.alert('错误', result.msg, 'error');
				}
			}
		});
		
		
		$("#remark").val('${company.remark}');
		
	});
</script>
<div class="easyui-layout" data-options="fit:true,border:false">
	<div data-options="region:'center',border:false" title="" style="overflow: hidden;padding: 3px;">
		<form id="companyEditForm" method="post">
			<table class="grid">
				<tr>
					<td>航司编号</td>
					<td><input name="id" type="hidden"  value="${company.id}">
					<input name="no" type="text" placeholder="请输入航司编号" class="easyui-validatebox span2" style="width: 300px;height:24px" data-options="required:true" value="${company.no}"></td>
				</tr>
				<tr>
					<td>航司名称</td>
					<td>
					<input name="name" type="text" placeholder="" class="easyui-validatebox span2" style="width: 300px;height:24px" data-options="required:true" value="${company.name}"></td>
				</tr>
				<tr>
					<td>联系人姓名</td>
					<td><input name="contacts" type="text" placeholder="" class="easyui-validatebox span2" style="width: 300px;height:24px" data-options="required:true" value="${company.contacts}"></td>
				</tr>
				<tr>
					<td>联系人电话</td>
					<td><input name="phone" type="text" placeholder="" class="easyui-validatebox span2" style="width: 300px;height:24px" data-options="required:true" value="${company.phone}"></td>
				</tr>
				<tr>
					<td>联系人职务</td>
					<td><input name="position" type="text" placeholder="" class="easyui-validatebox span2" style="width: 300px;height:24px" data-options="" value="${company.position}"></td>
				</tr>
				<tr>
				<td>性别</td>
				<td><select name="sex" class="easyui-combobox" data-options="width:300,height:29,editable:false,panelHeight:'auto'">
						<c:forEach items="${sexList}" var="sexList">
							<option value="${sexList.key}" <c:if test="${sexList.key == company.sex}">selected="selected"</c:if>>${sexList.value}</option>
						</c:forEach>
					</select></td>
				</tr>
				<tr>
					<td>航司地址</td>
					<td><input name="address" type="text" placeholder="" class="easyui-validatebox span2" style="width: 300px;height:24px" data-options="required:true" value="${company.address}"></td>
				</tr>
				<tr>
					<td>备注</td>
					<td colspan="3"><textarea id="remark" name="remark" rows="5" cols="40" ></textarea></td>
				</tr>
			</table>
		</form>
	</div>
</div>